import request from '@/utils/request'

const userApi = {
  Login: '/user/login',
  queryUserMenuList: '/ha_menu/queryUserMenuTree',
  logout: '/logout'
}

/**
 * login func
 * parameter: {
 *     username: '',
 *     password: '',
 *     remember_me: true,
 *     captcha: '12345'
 * }
 * @param parameter
 * @returns {*}
 */
export function login (body) {
  return request({
    url: userApi.Login,
    method: 'post',
    data: body
  })
}

/**
 * 查询当前人菜单
 * @param {*} parameter 
 */
export function getCurrentUserMenu (parameter) {
  return request({
    url: userApi.queryUserMenuList,
    method: 'post',
    params: parameter
  })
}

/**
 *登出系统
 * @returns
 */
 export function logout () {
  return request({
      url: userApi.logout,
      method: 'post'
  })
}
